#ifndef __SAVE_CONFIGS_H
#define __SAVE_CONFIGS_H

#define DEFAULT_CONFIG_FILE "onvif.config"

// class name define
#define CLASS_PROFILE "Profiles"
#define CLASS_VECFG   "VideoEncoder Configurations"
#define CLASS_VSCFG   "VideoSource Configurations"
#define CLASS_VOCFG   "VideoOutput Configurations"
#define CLASS_ASCFG   "AudioSource Configurations"
#define CLASS_AOCFG   "AudioOutput Configurations"
#define CLASS_AECFG   "AudioEncoder Configurations"
#define CLASS_ADECFG  "AudioDecoder Configurations"
#define CLASS_VACFG   "VideoAnalytics Configurations"
#define CLASS_METACFG   "Metadata Configurations"

typedef enum
{
	TYPE_VS = 1,
	TYPE_VO,
	TYPE_AS,
	TYPE_AO,
	TYPE_VE,
	TYPE_AE,
	TYPE_ADEC,
	TYPE_VA,
	TYPE_META,
	TYPE_PROFILE,

	TYPE_STR,
	TYPE_DNS,
	TYPE_NTP,
	TYPE_DDNS,
	TYPE_NETFACE,

	TYPE_MAX
}CONFIG_SAVE_TYPE;

// deprecated
int save_configs(const char *name, void *config, CONFIG_SAVE_TYPE type);

// configuration file operations
int insert_config_default(const char *name,const char *token, void *config, CONFIG_SAVE_TYPE type);
int insert_config_default_byarray(const char *name,const char *token,char *array[],int size);
int update_config_default(const char *name,const char *token,void *config,CONFIG_SAVE_TYPE type);
int update_config_default_byarray(const char *name,const char *token,char *array[],int size);
int delete_config_default(const char *name, const char *token);
int query_config_default(const char *name,const char *token,char *config[], int size);
int query_all_config_default(const char *name, char *configs[], int set_size, int *config_num, int elem_size);
int free_all_space(char *configs[], int set_size, int elem_size);

int free_config_space(char *config[], int size);

#if 0
// transform struct datatype to string array interfaces
int transform_vsstruct_array(struct tt__VideoSourceConfiguration *pvs, char *array[], int size);
int transform_vostruct_array(struct tt__VideoOutputConfiguration*pvo, char *array[], int size);
int transform_asstruct_array(struct tt__AudioSourceConfiguration*pas, char *array[], int size);
int transform_aostruct_array(struct tt__AudioOutputConfiguration*pao, char *array[], int size);
int transform_vestruct_array(struct tt__VideoEncoderConfiguration*pve, char *array[], int size);
int transform_aestruct_array(struct tt__AudioEncoderConfiguration*pae, char *array[], int size);
int transform_adecstruct_array(struct tt__AudioDecoderConfiguration*padec, char *array[], int size);
int transform_vastruct_array(struct tt__VideoAnalyticsConfiguration*pva, char *array[], int size);
int transform_metastruct_array(struct tt__MetadataConfiguration*pmeta, char *array[], int size);
int transform_profilestruct_array(struct tt__Profile*profile, char *array[], int size);
#endif

#endif

